-
Notifications
You must be signed in to change notification settings - Fork 8.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Warn the user if the keyboard service is disabled #8095
Warn the user if the keyboard service is disabled #8095
Conversation
We should probably add a section in the docs under troubleshooting for this. Should we provide a link to that in the popup dialog? Also, I'm guessing the answer is "no" but do we want a "disable this warning" setting? |
The way to disable this warning is to enable that service. |
So as it turns out, the linter is set to auto pull the latest version, which is of course, broken. IMO, that's the last straw with the linter - I don't think we've gotten anything valuable from it frankly. |
DWORD cchBuffer = 0; | ||
GetServiceDisplayName(hManager.get(), TabletInputServiceKey.data(), nullptr, &cchBuffer); | ||
std::wstring buffer; | ||
cchBuffer += 1; // Add space for a null | ||
buffer.resize(cchBuffer); | ||
|
||
if (LOG_LAST_ERROR_IF(!GetServiceDisplayName(hManager.get(), | ||
TabletInputServiceKey.data(), | ||
buffer.data(), | ||
&cchBuffer))) | ||
{ | ||
return winrt::hstring{ TabletInputServiceKey }; | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You might appreciate this helper!
std::wstring serviceName;
wil::AdaptFixedSizeToAllocatedResult(serviceName, [hManager](PWSTR buffer, size_t size, size_t* needed) -> HRESULT {
DWORD cchBuffer{ static_cast<DWORD>(size) };
BOOL const success = GetServiceDisplayName(hManager.get(), TabletInputServiceKey.data(), buffer, &cchBuffer);
RETURN_LAST_ERROR_IF((success == FALSE) && (::GetLastError() != ERROR_INSUFFICIENT_BUFFER));
*needed = cchBuffer = 1; // +1 for the null terminator
return S_OK;
});
(this is a nit; I just think it's a cool helper!)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
reckon you've gotta check the HR return from AdaptFixedSize...
DWORD cchBuffer = 0; | ||
GetServiceDisplayName(hManager.get(), TabletInputServiceKey.data(), nullptr, &cchBuffer); | ||
std::wstring buffer; | ||
cchBuffer += 1; // Add space for a null | ||
buffer.resize(cchBuffer); | ||
|
||
if (LOG_LAST_ERROR_IF(!GetServiceDisplayName(hManager.get(), | ||
TabletInputServiceKey.data(), | ||
buffer.data(), | ||
&cchBuffer))) | ||
{ | ||
return winrt::hstring{ TabletInputServiceKey }; | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
reckon you've gotta check the HR return from AdaptFixedSize...
Co-authored-by: Dustin L. Howett <duhowett@microsoft.com>
Hello @zadjii-msft! Because this pull request has the p.s. you can customize the way I help with merging this pull request, such as holding this pull request until a specific person approves. Simply @mention me (
|
![kb-service-disabled](https://user-images.githubusercontent.com/18356694/97578533-eb792d80-19be-11eb-9b13-b771327a72a0.png) With this PR, the Terminal will check to make sure the "Touch, Keyboard and Handwriting Panel Service" is enabled at startup. If it isn't, then the Terminal won't be able to receive keyboard input (see #4448 and the 20 linked issues to that one). * See #4448 for more details * [x] Closes #7886 * [ ] Should this make #4448 not-open as well? * [x] I work here * [n/a] Tests added/passed * [x] Docs: MicrosoftDocs/terminal#168 I manually set the service to "Disabled", restarted the machine, verified the dialog opens (and that I'm unable to type in the Terminal), then re-set the service to automatic and rebooted, and the dialog doesn't appear. (cherry picked from commit d5d2b77)
🎉 Handy links: |
🎉 Handy links: |
Add a setting to turn off the warning if 'Touch Keyboard and Handwriting Panel Service' is disabled. The service might not start in some case, and it doesn't affect the input in some computer. This PR turn off the warning even if the service is disabled. The setting name is "inputServiceWarning". ## Validation Steps Performed I manually set the service to "Disabled", restarted the Terminal, verified the warning up, then set "inputServiceWarning" to false and restarted the Terminal, and the warning didn't appear. References #8095 References #7886 (comment)
Summary of the Pull Request
With this PR, the Terminal will check to make sure the "Touch, Keyboard and Handwriting Panel Service" is enabled at startup. If it isn't, then the Terminal won't be able to receive keyboard input (see #4448 and the 20 linked issues to that one).
References
PR Checklist
Validation Steps Performed
I manually set the service to "Disabled", restarted the machine, verified the dialog opens (and that I'm unable to type in the Terminal), then re-set the service to automatic and rebooted, and the dialog doesn't appear.